Skip to content

fix(tui): bidirectional Tab, Ctrl+Q detaches, remove broken Ctrl+T - #925

Merged
namastex888 merged 2 commits into
devfrom
fix/remove-empty-sessions
Mar 30, 2026
Merged

namastex888 merged 2 commits into
devfrom
fix/remove-empty-sessions

Conversation

@namastex888

Copy link
Copy Markdown
Contributor

Follow-up to #924. Tab was one-way, Ctrl+Q killed session instead of detaching.

Genie added 2 commits March 30, 2026 08:07
serve no longer pre-creates empty bash sessions for every agent.
Sessions are created on-demand by genie spawn. TUI Enter handler
spawns the agent if not running, then attaches.
- Tab toggles between nav and terminal (bidirectional, was one-way)
- Ctrl+Q detaches from TUI (was killing session)
- Remove Ctrl+T send-keys to nested tmux (broken, will be reimplemented)
- Remove startAgentTmuxServer from serve (no empty sessions)
- Enter spawns agent if not running, then attaches
@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d16b2cc8-f3c3-4683-9ea0-88276fc6d1a1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remove-empty-sessions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@namastex888
namastex888 merged commit 45053fa into dev Mar 30, 2026
6 checks passed
@namastex888
namastex888 deleted the fix/remove-empty-sessions branch March 30, 2026 12:09

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors agent session management by removing pre-emptive tmux session creation in favor of on-demand spawning. It also updates TUI keybindings to allow toggling between panes and changes the exit behavior to detach the client instead of killing the session. A review comment suggests improving error handling during the keybinding setup to prevent silent failures that could complicate debugging.

for (const cmd of bindings) {
try {
execSync(tuiTmux(cmd), { stdio: 'ignore' });
} catch {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Silently catching and ignoring errors can make debugging difficult if a tmux command fails unexpectedly. Consider logging the error at a debug level or adding a comment explaining why the error is intentionally ignored here.

    } catch (error) {
      // Consider logging the error here for debugging purposes.
    }

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57e1f1381a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +369 to 371
// 2. Report agent tmux server state (don't create empty sessions —
// sessions are created on-demand by `genie spawn`).
const sessions = listAgentSessions();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Start agent tmux server with config before on-demand sessions

This change stops initializing tmux -L genie via genieTmuxConf() at serve startup, so a fresh run with no sessions now relies on later on-demand creation. In that flow, the TUI attach path calls ensureAgentSession in src/tui/tmux.ts, which creates the first server with bare tmux -L genie new-session (no -f), so ~/.genie/tmux.conf/the shipped config is never loaded for that server process. The result is inconsistent tmux behavior (status/options/keybindings) until the server is manually killed and restarted with config.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant